package com.study.demo_cache_redis.component;

import org.springframework.cache.interceptor.KeyGenerator;
import org.springframework.stereotype.Component;

import java.lang.reflect.Method;
import java.util.Arrays;

/**
 * @ClassName: MyKeyGenerator
 * @Description:
 * @author: WS
 * @date 2020/12/26
 * @Version: 1.0
 **/
@Component
public class MyKeyGenerator implements KeyGenerator {
    @Override
    public Object generate(Object o, Method method, Object... objects) {
        return o.getClass().getName() + ":" + method.getName() + ":" + Arrays.toString(objects);
    }
}
